<?php


namespace api\zhengmaotong\validate;


use think\Validate;

class UserValidate extends Validate
{
    protected $rule = [
        'name'=>'requireif:account_type,2|max:20',
        'mobile' => 'require|mobile',
        'code'=>'require',
    ];
    protected $message = [
        'name.require' => '请输入用户名',
        'name.max:20' => '最大数字为20',
        'mobile.unique:users' => '只能在user表中使用',
        'mobile.require' => '请输入手机号',
        'code.require' => '请输入验证码',
    ];
    protected $scene = [
        'register'=>['name','mobile','code'],
        'login'=>['mobile','code'],
        'mess'=>['mobile','name'],
        'edit'=>['mobile','name']
    ];
}